/*    */ package chai.ning.returns;
/*    */ 
/*    */ import java.io.PrintStream;
/*    */ import java.util.Arrays;
/*    */ 
/*    */ public class ArrayHelper
/*    */ {
/*    */   public static ArrayHelper getInstance()
/*    */   {
/*  8 */     ArrayHelper ah = new ArrayHelper();
/*  9 */     return ah;
/*    */   }
/*    */ 
/*    */   public byte[] sort(byte[] bytes) {
/* 13 */     int n = bytes.length;
/* 14 */     byte[] newArray = new byte[n];
/* 15 */     System.arraycopy(bytes, 0, newArray, 0, n);
/* 16 */     for (int k = 0; k < n - 1; k++) {
/* 17 */       for (int j = 0; j < n - 1 - k; j++) {
/* 18 */         if (newArray[j] > newArray[(j + 1)])
/*    */         {
/*    */           int tmp43_41 = j;
/*    */           byte[] tmp43_40 = newArray; tmp43_40[tmp43_41] = (byte)(tmp43_40[tmp43_41] ^ newArray[(j + 1)]);
/*    */           int tmp59_58 = (j + 1);
/*    */           byte[] tmp59_54 = newArray; tmp59_54[tmp59_58] = (byte)(tmp59_54[tmp59_58] ^ newArray[j]);
/*    */           int tmp71_69 = j;
/*    */           byte[] tmp71_68 = newArray; tmp71_68[tmp71_69] = (byte)(tmp71_68[tmp71_69] ^ newArray[(j + 1)]);
/*    */         }
/*    */       }
/*    */     }
/* 25 */     return newArray;
/*    */   }
/*    */ 
/*    */   public int[] sort(int[] ints) {
/* 29 */     int n = ints.length;
/*    */ 
/* 31 */     int[] newArray = new int[n];
/* 32 */     System.arraycopy(ints, 0, newArray, 0, n);
/* 33 */     for (int k = 0; k < n - 1; k++) {
/* 34 */       for (int j = 0; j < n - 1 - k; j++) {
/* 35 */         if (newArray[j] > newArray[(j + 1)]) {
/* 36 */           newArray[j] ^= newArray[(j + 1)];
/* 37 */           newArray[(j + 1)] ^= newArray[j];
/* 38 */           newArray[j] ^= newArray[(j + 1)];
/*    */         }
/*    */       }
/*    */     }
/* 42 */     return newArray;
/*    */   }
/*    */ 
/*    */   public char[] sort(char[] chars) {
/* 46 */     int n = chars.length;
/* 47 */     char[] newArray = new char[n];
/* 48 */     System.arraycopy(chars, 0, newArray, 0, n);
/* 49 */     for (int k = 0; k < n - 1; k++) {
/* 50 */       for (int j = 0; j < n - 1 - k; j++) {
/* 51 */         if (newArray[j] > newArray[(j + 1)])
/*    */         {
/*    */           int tmp43_41 = j;
/*    */           char[] tmp43_40 = newArray; tmp43_40[tmp43_41] = (char)(tmp43_40[tmp43_41] ^ newArray[(j + 1)]);
/*    */           int tmp59_58 = (j + 1);
/*    */           char[] tmp59_54 = newArray; tmp59_54[tmp59_58] = (char)(tmp59_54[tmp59_58] ^ newArray[j]);
/*    */           int tmp71_69 = j;
/*    */           char[] tmp71_68 = newArray; tmp71_68[tmp71_69] = (char)(tmp71_68[tmp71_69] ^ newArray[(j + 1)]);
/*    */         }
/*    */       }
/*    */     }
/* 58 */     return newArray;
/*    */   }
/*    */ 
/*    */   public static void main(String[] args)
/*    */   {
/* 63 */     ArrayHelper ah = getInstance();
/*    */ 
/* 66 */     char[] chars = { '三', '一', '六', '八', '二' };
/* 67 */     System.out.println(Arrays.toString(chars));
/*    */ 
/* 69 */     char[] array = ah.sort(chars);
/* 70 */     System.out.println(Arrays.toString(array));
/* 71 */     System.out.println(Arrays.toString(chars));
/*    */ 
/* 73 */     for (int i = 0; i < array.length; i++)
/*    */     {
/* 75 */       int num = array[i];
/* 76 */       System.out.println(num);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\D\eclipse-workspace\methods\bin\
 * Qualified Name:     chai.ning.returns.ArrayHelper
 * JD-Core Version:    0.6.0
 */